
  ___  ____  ____  ____  ____ (R)
 /__    /   ____/   /   ____/
___/   /   /___/   /   /___/   15.1   Copyright 1985-2017 StataCorp LLC
  Statistics/Data Analysis            StataCorp
                                      4905 Lakeway Drive
     MP - Parallel Edition            College Station, Texas 77845 USA
                                      800-STATA-PC        http://www.stata.com
                                      979-696-4600        stata@stata.com
                                      979-696-4601 (fax)

32-user 64-core Stata network perpetual license:
       Serial number:  501506200495
         Licensed to:  Harvard-MIT Data Center
                       Cambridge, MA

Notes:
      1.  Stata is running in batch mode.
      2.  Unicode is supported; see help unicode_advice.
      3.  More than 2 billion observations are allowed; see help obs_advice.
      4.  Maximum number of variables is set to 5000; see help set_maxvar.

. do "dofiles/6_estimates_figureA2.do" 

. /*
> Replication files for "Housing Discrimination and the Pollution Exposure Gap 
> in the United States" 
> */
. 
. 
. clear all

. set matsize 11000

. 
. use "../stores/toxic_discrimination_data.dta"

. 
. 
. loc quartiles 4

. 
. set seed 1010101

. *****************************************************************************
> *******************
. * Minority
. *****************************************************************************
> *******************
. * Within 1 more than 1
. *****************************************************************************
> *******************
. 
. 
. disc_boot choice Minority_within1  Minority_more1   , varlist(i.gender i.educ
> ation_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,504 groups (4,512 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood =  -1025.129  
Iteration 1:   log pseudolikelihood = -1016.9346  
Iteration 2:   log pseudolikelihood = -1016.9161  
Iteration 3:   log pseudolikelihood = -1016.9161  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      3,012
                                                Wald chi2(7)      =      88.66
                                                Prob > chi2       =     0.0000
Log pseudolikelihood = -1016.9161               Pseudo R2         =     0.0781

                              (Std. Err. adjusted for 19 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_w~1 |   -.127234   .1310621    -0.97   0.332    -.3428121     .088344
Minority_m~1 |   -.403442   .0985365    -4.09   0.000    -.5655201   -.2413639
             |
      gender |
       male  |  -.3217206   .0895021    -3.59   0.000    -.4689384   -.1745028
             |
education_~l |
        low  |  -.1959768   .1089205    -1.80   0.072     -.375135   -.0168186
     medium  |  -.3273174   .1265243    -2.59   0.010    -.5354313   -.1192034
             |
       order |
          2  |  -.2977677   .2199541    -1.35   0.176    -.6595601    .0640246
          3  |   -.878198   .1843631    -4.76   0.000    -1.181448   -.5749476
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Minority_w~1 |   -.127234   .1336799    -0.95   0.354    -.3590435    .1045755
Minority_m~1 |   -.403442   .1145356    -3.52   0.002    -.6020541   -.2048299
------------------------------------------------------------------------------

. mat def b=e(b)

. mat def V=e(V)

. 
. 
. 
. mat def R=J(2,3,.)

. 
. forvalues i= 1/2{
  2.         mat R[`i',1]=b[1,`i']
  3.         mat R[`i',2]=V[`i',`i']
  4.         mat R[`i',3]=e(df_`i')
  5.         }

. 
. matrix define B=J(2,5,.)

. 
. forvalues i= 1/2{
  2.         matrix B[`i',1] =  R[`i',1] - invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  3.         matrix B[`i',2] =  R[`i',1] 
  4.         matrix B[`i',3] =  R[`i',1] + invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  5. }

. 
.         
.         
. 
. 
.         sum Minority if within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Minority |      3,627    .6666667    .4714695          0          1

.         matrix B[1,4]=`r(N)'

. 
.         sum Minority if more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Minority |      3,897    .6666667     .471465          0          1

.         matrix B[2,4]=`r(N)'

.         
. 
.         sum choice if White==1 &  within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,209    .4028122    .4906666          0          1

.         matrix B[1,5]=`r(mean)'

. 
.         sum choice if White==1 &  more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,299    .3979985    .4896736          0          1

.         matrix B[2,5]=`r(mean)'

. mat list B      

B[2,5]
            c1          c2          c3          c4          c5
r1   -.3590435  -.12723402   .10457546        3627   .40281224
r2  -.60205408    -.403442  -.20482992        3897   .39799846

. 
. 
. 
. 
. *****************************************************************************
> *******************
. * Matrix to dta
. *****************************************************************************
> *******************
. preserve

. clear

. svmat B
number of observations will be reset to 2
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 2

. gen n=_n

. replace B1=exp(B1)
(2 real changes made)

. replace B2=exp(B2)
(2 real changes made)

. replace B3=exp(B3)
(2 real changes made)

. 
. 
. 
. rename B1 lci

. rename B2 or

. rename B3 uci

. rename B4 obs

. rename B5 c_mean

. rename n distance

. 
. 
. save "../stores/aux/distance_minority_full_set_bootcl.dta"      , replace
(note: file ../stores/aux/distance_minority_full_set_bootcl.dta not found)
file ../stores/aux/distance_minority_full_set_bootcl.dta saved

. restore

. 
. *****************************************************************************
> *******************
. * African American vs Hispanic/LatinX
. *****************************************************************************
> *******************
. * Within 1 more than 1
. *****************************************************************************
> *******************
. disc_boot choice  Hispanic_within1  Hispanic_more1  ///
>                                           Black_within1  Black_more1   , varl
> ist(i.gender i.education_level i.order)
note: multiple positive outcomes within groups encountered.
note: 1,504 groups (4,512 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -1009.8842  
Iteration 1:   log pseudolikelihood = -1000.4951  
Iteration 2:   log pseudolikelihood =  -1000.448  
Iteration 3:   log pseudolikelihood =  -1000.448  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      3,012
                                                Wald chi2(9)      =     124.07
                                                Prob > chi2       =     0.0000
Log pseudolikelihood =  -1000.448               Pseudo R2         =     0.0930

                              (Std. Err. adjusted for 19 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice |      Coef.   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_w~1 |   .1213993   .0932845     1.30   0.193    -.0320399    .2748386
Hispanic_m~1 |  -.1884208   .0699292    -2.69   0.007    -.3034442   -.0733975
Black_with~1 |  -.3658996   .1933614    -1.89   0.058    -.6839508   -.0478483
 Black_more1 |  -.6328034   .1385266    -4.57   0.000    -.8606594   -.4049474
             |
      gender |
       male  |  -.3190958   .0916778    -3.48   0.001    -.4698923   -.1682993
             |
education_~l |
        low  |  -.2321114    .117164    -1.98   0.048     -.424829   -.0393938
     medium  |  -.3464351   .1206285    -2.87   0.004    -.5448513   -.1480189
             |
       order |
          2  |   -.293855   .2267255    -1.30   0.195    -.6667853    .0790753
          3  |   -.884174   .1914442    -4.62   0.000    -1.199072   -.5692762
------------------------------------------------------------------------------
cluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codecluster(Zip_Code)Zip_Codeclus
> ter(Zip_Code)Zip_Code

Bootstrap Corrected Estimates
------------------------------------------------------------------------------
             |      Coef.   Std. Err.      t    P>|t|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_w~1 |   .1213993    .097711     1.24   0.230    -.0480378    .2908365
Hispanic_m~1 |  -.1884208   .0777674    -2.42   0.026    -.3232745   -.0535672
Black_with~1 |  -.3658996   .2081108    -1.76   0.096    -.7267769   -.0050223
 Black_more1 |  -.6328034   .1612549    -3.92   0.001    -.9124296   -.3531772
------------------------------------------------------------------------------

. 
. mat def b=e(b)

. mat def V=e(V)

. 
. 
. 
. mat def R=J(4,3,.)

. 
. forvalues i= 1/4{
  2.         mat R[`i',1]=b[1,`i']
  3.         mat R[`i',2]=V[`i',`i']
  4.         mat R[`i',3]=e(df_`i')
  5.         }

. 
. 
. matrix define H=J(2,5,.)

. forvalues i= 1/2{
  2.         matrix H[`i',1] =  R[`i',1] - invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  3.         matrix H[`i',2] =  R[`i',1] 
  4.         matrix H[`i',3] =  R[`i',1] + invttail(R[`i',3],0.05)*sqrt(R[`i',2
> ])
  5. }

. 
.         sum Hispanic if within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Hispanic |      3,627    .3333333    .4714695          0          1

.         matrix H[1,4]=`r(N)'

. 
.         sum Hispanic if more1 ==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    Hispanic |      3,897    .3333333     .471465          0          1

.         matrix H[2,4]=`r(N)'

.         mat list H

H[2,5]
            c1          c2          c3          c4          c5
r1  -.04803779   .12139933   .29083645        3627           .
r2   -.3232745  -.18842084  -.05356718        3897           .

. 
.         sum choice if White==1 &  within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,209    .4028122    .4906666          0          1

.         matrix H[1,5]=`r(mean)'

. 
.         sum choice if White==1 &  more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,299    .3979985    .4896736          0          1

.         matrix H[2,5]=`r(mean)'

.         mat list H

H[2,5]
            c1          c2          c3          c4          c5
r1  -.04803779   .12139933   .29083645        3627   .40281224
r2   -.3232745  -.18842084  -.05356718        3897   .39799846

. 
. 
. matrix define B=J(2,5,.)

. 
. forvalues i= 1/2{
  2.         matrix B[`i',1] =  R[`i'+2,1] - invttail(R[`i'+2,3],0.05)*sqrt(R[`
> i'+2,2])
  3.         matrix B[`i',2] =  R[`i'+2,1] 
  4.         matrix B[`i',3] =  R[`i'+2,1] + invttail(R[`i'+2,3],0.05)*sqrt(R[`
> i'+2,2])
  5. }

. 
. 
.         sum Black if within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       Black |      3,627    .3333333    .4714695          0          1

.         matrix B[1,4]=`r(N)'

. 
.         sum Black if more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       Black |      3,897    .3333333     .471465          0          1

.         matrix B[2,4]=`r(N)'

.         mat list B

B[2,5]
            c1          c2          c3          c4          c5
r1  -.72677687  -.36589956  -.00502225        3627           .
r2  -.91242958  -.63280341  -.35317724        3897           .

. 
.         sum choice if White==1 &  within1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,209    .4028122    .4906666          0          1

.         matrix B[1,5]=`r(mean)'

. 
.         sum choice if White==1 &  more1==1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      choice |      1,299    .3979985    .4896736          0          1

.         matrix B[2,5]=`r(mean)'

.         mat list B

B[2,5]
            c1          c2          c3          c4          c5
r1  -.72677687  -.36589956  -.00502225        3627   .40281224
r2  -.91242958  -.63280341  -.35317724        3897   .39799846

. 
. 
. 
. 
. *****************************************************************************
> *******************
. * Matrix to dta
. *****************************************************************************
> *******************
. preserve

. clear

. svmat B
number of observations will be reset to 2
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 2

. gen n=_n

. replace B1=exp(B1)
(2 real changes made)

. replace B2=exp(B2)
(2 real changes made)

. replace B3=exp(B3)
(2 real changes made)

. 
. 
. 
. rename B1 lci

. rename B2 or

. rename B3 uci

. rename B4 obs

. rename B5 c_mean

. rename n distance

. 
. 
. 
. save "../stores/aux/distance_race_afam_full_set_bootcl.dta"     , replace
(note: file ../stores/aux/distance_race_afam_full_set_bootcl.dta not found)
file ../stores/aux/distance_race_afam_full_set_bootcl.dta saved

. restore

. 
. preserve

. clear

. svmat H
number of observations will be reset to 2
Press any key to continue, or Break to abort
number of observations (_N) was 0, now 2

. gen n=_n

. replace H1=exp(H1)
(2 real changes made)

. replace H2=exp(H2)
(2 real changes made)

. replace H3=exp(H3)
(2 real changes made)

. 
. 
. 
. rename H1 lci

. rename H2 or

. rename H3 uci

. rename H4 obs

. rename H5 c_mean

. rename n distance

. 
. 
. 
. save "../stores/aux/distance_race_hispanic_full_set_bootcl.dta" , replace
(note: file ../stores/aux/distance_race_hispanic_full_set_bootcl.dta not found)
file ../stores/aux/distance_race_hispanic_full_set_bootcl.dta saved

. restore

. 
. 
. clogit choice Hispanic_within1  Hispanic_more1  ///
>                                           Black_within1  Black_more1  ///
>                                           i.order i.gender  i.education_level
>  , group(Address) or  cl(Zip_Code) level(90)
note: multiple positive outcomes within groups encountered.
note: 1,504 groups (4,512 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -1009.8842  
Iteration 1:   log pseudolikelihood = -1000.4951  
Iteration 2:   log pseudolikelihood =  -1000.448  
Iteration 3:   log pseudolikelihood =  -1000.448  

Conditional (fixed-effects) logistic regression

                                                Number of obs     =      3,012
                                                Wald chi2(9)      =     124.07
                                                Prob > chi2       =     0.0000
Log pseudolikelihood =  -1000.448               Pseudo R2         =     0.0930

                              (Std. Err. adjusted for 19 clusters in Zip_Code)
------------------------------------------------------------------------------
             |               Robust
      choice | Odds Ratio   Std. Err.      z    P>|z|     [90% Conf. Interval]
-------------+----------------------------------------------------------------
Hispanic_w~1 |   1.129076   .1053252     1.30   0.193     .9684679    1.316318
Hispanic_m~1 |   .8282661     .05792    -2.69   0.007     .7382711    .9292314
Black_with~1 |   .6935725   .1341102    -1.89   0.058     .5046194    .9532784
 Black_more1 |   .5311008   .0735716    -4.57   0.000     .4228831    .6670119
             |
       order |
          2  |   .7453846   .1689977    -1.30   0.195     .5133562    1.082286
          3  |   .4130552    .079077    -4.62   0.000     .3014739    .5659349
             |
      gender |
       male  |   .7268059   .0666319    -3.48   0.001     .6250696    .8451009
             |
education_~l |
        low  |   .7928578   .0928944    -1.98   0.048     .6538816     .961372
     medium  |   .7072047    .085309    -2.87   0.004      .579928    .8624148
------------------------------------------------------------------------------

. 
. 
. 
. 
. 
. 
. 
. *end
. 
end of do-file
